﻿@using Webdiyer.WebControls.Mvc

@model IPagedList<UscSunShine.Mvc.Models.EditUserRoleViewModel>
@{
    ViewBag.Title = "用户列表";
}

<h2>用户列表</h2>


<p>
    @Html.ActionLink("新建用户", "Create")
</p>

<div id="views">

    <table class="table table-hover table-striped">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.UserName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Email)
            </th>
            <th></th>

        </tr>


        @foreach (var item in Model)
    {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.UserName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td>
                    @Html.ActionLink("编辑用户", "Edit", new { id = item.Id }) |
                    @Html.ActionLink("用户详情", "Details", new { id = item.Id })|
                    @Html.ActionLink("删除用户", "Delete", new { id = item.Id })
                </td>
            </tr>
    }
    </table>

    @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "index" }, new MvcAjaxOptions { UpdateTargetId = "views", EnablePartialLoading = true })
</div>
@section Scripts{@{Html.RegisterMvcPagerScriptResource();}}